﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;

namespace Ocelot.Admin.Api.Core
{
    /// <summary>
    /// 项目表
    ///</summary>
    [SugarTable("Project")]
    public class Project
    {
        /// <summary>
        /// 主键Id 
        ///</summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        /// <summary>
        /// 项目名称 
        ///</summary>
        [SugarColumn(ColumnName = "ProjectName")]
        public string ProjectName { get; set; }
        /// <summary>
        /// 排序字段 
        ///</summary>
        [SugarColumn(ColumnName = "OrderIndex")]
        public int OrderIndex { get; set; }
        /// <summary>
        /// 启用 
        ///</summary>
        [SugarColumn(ColumnName = "Enabled")]
        public bool Enabled { get; set; }
        /// <summary>
        /// 创建时间 
        ///</summary>
        [SugarColumn(ColumnName = "CreateTime")]
        public long CreateTime { get; set; }
        /// <summary>
        /// 编辑时间 
        ///</summary>
        [SugarColumn(ColumnName = "UpdateTime")]
        public long UpdateTime { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(Route.ProjectId))]//一对多
        public List<Route> Routes { get; set; }//只能是null不能赋默认值
    }
}
